<!DOCTYPE html>
<!--
To change this license header, choose License Headers in Project Properties.
To change this template file, choose Tools | Templates
and open the template in the editor.
-->
<html>
    <head>
        <title>JS - 1.2</title>
        <meta charset="UTF-8">
        <meta name="viewport" content="width=device-width">
        <script>
            function compterCaracteres() {
                var valeurTexte = document.formulaire.champTexte.value;
                var nombreCaracteres = valeurTexte.length;
                alert(nombreCaracteres);
            }
        </script>
    </head>

    <body>
        <form name="formulaire">
            <input type="text" name="champTexte" value="">
            <input type="button" value="Compter le nombre de caractères !" onclick="compterCaracteres();">
        </form>
    </body>
</html>
